<template>
  <div id="formDetail">
    <c-title :hide="false" text="查看详情"></c-title>
    <div class="memberView">
      <div class="title" v-if="list.diyform_type">{{ list.diyform_type.title }}</div>
      <div class="time">
        <span>填写时间：</span>
        {{ list.created_at }}
      </div>
      <div class="member" v-if="list.member">
        <span>会员昵称：</span>
        {{ list.member.nickname }}
      </div>
    </div>
    <div class="memberView">
      <diyfrom
        modeType="single"
        :desThumb="false"
        :singleDatas="list.diyform_type.form_type"
        :singleStatus="false"
        v-if="list.form_id"
        :form_id="list.form_id"
        :form_data_id="list.id"
        :goodsId="goodsId"
        :optionsId="optionsId"
        :total="total"
        :tag="tag"
        :extinfo="extinfo"
      ></diyfrom>
    </div>
  </div>
</template>
<script>
import diyfrom from "../../components/diyform";
export default {
  data() {
    return {
      list: [],

      //more
      isLoadMore: true,
      page: 1,
      total_page: 0
    };
  },
  activated() {
    this.getData();
  },
  components: { diyfrom },
  methods: {
    getData() {
      $http
        .post("plugin.diyform.api.diy-form.formDataDetail", { form_data_id: this.$route.params.id })
        .then(res => {
          if (res.result == 1) {
            this.list = res.data;
            console.log(this.list);
            this.isLoadMore = true;
            this.total_page = res.data.last_page;
            if (!this.total_page) {
              this.total_page = 0;
            }
          }
        })
        .catch(err => {
          console.log(err);
        });
    }
  }
};
</script>
<style lang="scss" scoped>
#formDetail {
  // background: #fff;
  // min-height: 100vh;
  .memberView {
    margin: 0.75rem 0.75rem 0.5rem 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: #fff;
    text-align: left;
    font-size: 0.8125rem;

    .title {
      margin-bottom: 0.625rem;
    }

    .time {
      margin-bottom: 0.625rem;

      span {
        color: #999;
      }
    }

    .member {
      span {
        color: #999;
      }
    }
  }
}
</style>